package com.doctcloud.hisystem.common.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.doctcloud.hisystem.common.mapper.SysDictDataEntityMapper;
import com.doctcloud.hisystem.common.service.ISysDictDataEntityService;
import com.doctcloud.hisystem.tables.domain.common.SysDictDataEntity;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author :  doctCloud samula
 * @date :  2025/11/24
 * @Descript :
 */
@Service
@Slf4j
public class SysDictDataEntityServiceImpl extends ServiceImpl<SysDictDataEntityMapper, SysDictDataEntity> implements ISysDictDataEntityService {
    /**
     * 根据条件分页查询字典数据
     *
     * @param dictData 字典数据信息
     * @return 字典数据集合信息
     */
    @Override
    public List<SysDictDataEntity> selectDictDataList(SysDictDataEntity dictData) {
        return baseMapper.select(dictData);
    }

    @Override
    public String selectDictLabel(String dictType, String dictValue) {
        return baseMapper.selectDictLabel(dictType,dictValue);
    }

    @Override
    public SysDictDataEntity selectDictDataById(Long dictCode) {
        return baseMapper.selectByPrimaryKey(dictCode);
    }

    @Override
    public int deleteDictDataByIds(List<Long> dictCodes) {
        return baseMapper.deleteByPrimaryKeys(dictCodes);
    }

    @Override
    public int insertDictData(SysDictDataEntity dictData) {
        return baseMapper.insert(dictData);
    }

    @Override
    public int updateDictData(SysDictDataEntity dictData) {
        return baseMapper.updateByPrimaryKeySelective(dictData);
    }
}
